# 输入: s = "abcabcbb"
# 输出: 3
# 解释: 因为无重复字符的最长子串是 "abc"，所以其长度为 3
# "aaaa"运行100次
# "acde"
# ""
# "123"
# "12312333"
# "/><"
# "11111111111111111111111111111111111111111111111"
# "abcabccc"
# "bbbb"
# "aaaabcabc"
# "aaabcabcaa"

s = "acde"
l=0
n=len(s)
dic={}
ans=0
for r in range(n):
    dic[s[r]]=dic.get(s[r],0)+1
    while dic[s[r]]>1:
        dic[s[l]]-=1
        l+=1
        # ans=max(ans,r-l+1)
    ans= max(ans, r - l + 1)
print(ans)
